/********************************************************************************
 * Project Name		[JavaSE_Fundamentals]
 * File Name     	[TestRuntime.java]
 * Creation Date 	[2015-01-01]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ********************************************************************************/
package api.lang;

/**
 * java.lang.Runtime测试<br/>
 * 
 * 该类类主要代表了应用程序运行的环境<br/>
 * 
 * @author 不落的太阳(Sean Yang aka ShortPeace)
 * @version 1.0
 * @since jdk 1.8
 * 
 */
public class TestRuntime {

	public static void main(String[] args) throws Exception {
		Runtime runtime = Runtime.getRuntime(); // 返回当前应用程序的运行环境对象
		Process process = runtime.exec("C:\\Windows\\notepad.exe"); // 根据指定的路径执行对应的可执行文件
		Thread.sleep(3000);
		process.destroy();

		System.out.println("JVM fee memory = " + runtime.freeMemory());
		System.out.println("JVM max memory = " + runtime.maxMemory());
		System.out.println("JVM total memory = " + runtime.totalMemory());
	}
}
